package com.smm.web.vmc.controller.User;

import com.smm.web.vmc.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by zhenghao on 2016/8/31.
 * 用户登出
 */
@Slf4j
@Controller
public class LogOutController {

    @RequestMapping("/logout.do")
    public ModelAndView logout(HttpServletRequest request){

        //从session中删除会员id
        request.getSession().removeAttribute(UserService.USER_SESSION_KEY);

        return new ModelAndView("login");
    }


}
